<!DOCTYPE HTML>
<html>
<head>
    <title>帮教管理--救助页面</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/common/common.js" type="text/javascript"></script>
</head>
<style>
    .delBtn {
        border:1px solid #ff2120;
        border-radius:10px;
        font-size:8px;
        line-height:20px;
        font-weight:bold;
        color:#ff4634;
    }
    .editBtn {
        border:1px solid #018d00;
        border-radius:10px;
        font-size:8px;
        line-height:20px;
        font-weight:bold;
        color:#00a60a;
    }
</style>
<body onload="onLoad()">
<div class="mini-fit">
    <form id="form1" method="post" style="padding:10px;">
        <!-- 用户 编辑框START-->
        <div id="editform" class="form">
            <table class="form-table" width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>救助时间:</td>
                    <td>
                        ${jztime!''}
                    </td>
                </tr>
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>户&emsp;&emsp;籍:</td>
                    <td class="input">
                        <#if huji ?? && huji = 1>已落户
                        <#elseif huji ?? && huji = 2>未落户
                        </#if>
                    </td>
                </tr>
            </table>
        </div>
        <div id="editform1" class="form">
            <table class="form-table" width="100%">
                <tr>
                    <td width="30%" align="right" style="line-height: 30px;">
                        <span style="font-size:15px;font-weight: bold">救助类型&emsp;&emsp;&emsp;&emsp;</span>
                    </td>
                    <td>

                    </td>
                </tr>
            </table>
        </div>

        <#if shehuijiuzhu ?? && shehuijiuzhu?index_of("1")!=-1 >
            <div id="editform1" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">
                            <span style="font-size:15px;font-weight: bold;color: blue ">落实最低生活保障</span>

                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
            </div>

            <div id="editformDb" class="form">
                <table class="form-table" width="100%">

                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                        <td>
                            ${dbLxr!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right"><font color="#dc143c">*</font>落实低保联系人手机号码:</td>
                        <td class="input">
                            ${dbPhone!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right"><font color="#dc143c">*</font>落实低保联系人固话:</td>
                        <td class="input">
                            ${dbTel!''}
                        </td>
                    </tr>
                </table>
            </div>
            <div id="editform11" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" valign="top" style="line-height: 30px;">备注:</td>
                        <td class="input">
                            ${dbRemark!''}
                        </td>
                    </tr>
                </table>
            </div>
        </#if>
        <#if  shehuijiuzhu ?? && shehuijiuzhu?index_of("2")!=-1 >
            <div id="editform2" class="form">
                <table class="form-table" width="100%">

                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">
                            <span style="font-size:15px;font-weight: bold;color: blue ">落实特困人员供养</span>
                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
            </div>

            <div id="editformTk" class="form">
                <table class="form-table" width="100%">

                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                        <td>
                            ${tkLxr!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实特困联系人手机号码:</td>
                        <td class="input">
                            ${tkPhone!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实特困联系人固话:</td>
                        <td class="input">
                            ${tkTel!''}
                        </td>
                    </tr>
                </table>
            </div>
            <div id="editform21" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" valign="top" style="line-height: 30px;">备注:</td>
                        <td class="input">
                            ${tkRemark!''}
                        </td>
                    </tr>
                </table>
            </div>
        </#if>
        <#if  shehuijiuzhu ?? && shehuijiuzhu?index_of("3")!=-1 >
            <div id="editform3" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">
                            <span style="font-size:15px;font-weight: bold;color: blue ">落实医疗救助&emsp;&emsp;</span>
                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
            </div>

            <div id="editformYl" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                        <td>
                            ${ylLxr!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实医疗联系人手机号码:</td>
                        <td class="input">
                            ${ylPhone!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实医疗联系人固话:</td>
                        <td class="input">
                            ${ylTel!''}
                        </td>
                    </tr>
                </table>
            </div>
            <div id="editform31" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">备注:</td>
                        <td class="input">
                            ${ylRemark!''}
                        </td>
                    </tr>
                </table>
            </div>
        </#if>
        <#if shehuijiuzhu ?? && shehuijiuzhu?index_of("4")!=-1 >

            <div id="editform4" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">
                            <span style="font-size:15px;font-weight: bold;color: blue ">落实教育救助&emsp;&emsp;</span>
                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
            </div>

            <div id="editformJy" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                        <td>
                            ${jyLxr!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实教育联系人手机号码:</td>
                        <td class="input">
                            ${jyPhone!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实教育联系人固话:</td>
                        <td class="input">
                            ${jyTel!''}
                        </td>
                    </tr>
                </table>
            </div>
            <div id="editform41" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">备注:</td>
                        <td class="input">
                            ${jyRemark!''}
                        </td>
                    </tr>
                </table>
            </div>
        </#if>
        <#if  shehuijiuzhu ?? && shehuijiuzhu?index_of("5")!=-1 >
            <div id="editform5" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">
                            <span style="font-size:15px;font-weight: bold;color: blue ">落实住房救助&emsp;&emsp;</span>
                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
            </div>

            <div id="editformZf" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;"><font color="#dc143c">*</font>落实联系人:</td>
                        <td>
                            ${zfLxr!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实住房联系人手机号码:</td>
                        <td class="input">
                            ${zfPhone!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实住房联系人固话:</td>
                        <td class="input">
                            ${zfTel!''}
                        </td>
                    </tr>
                </table>
            </div>

            <div id="editform51" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">备注:</td>
                        <td class="input">
                            ${zfRemark!''}
                        </td>
                    </tr>
                </table>
            </div>
        </#if>
        <#if  shehuijiuzhu ?? && shehuijiuzhu?index_of("6")!=-1 >
            <div id="editform6" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">
                            <span style="font-size:15px;font-weight: bold;color: blue ">落实其他&emsp;&emsp;&emsp;&emsp;</span>
                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
            </div>
            <div id="editformQt" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">落实联系人:</td>
                        <td>
                            ${qtTel!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实其他联系人手机号码:</td>
                        <td class="input">
                            ${qtPhone!''}
                        </td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" valign="top"><font color="#dc143c">*</font>落实其他联系人固话:</td>
                        <td class="input">
                            ${qtLxr!''}
                        </td>
                    </tr>
                </table>
            </div>

            <div id="editform6" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td width="30%" align="right" style="line-height: 30px;">备注:</td>
                        <td class="input">
                            ${qtRemark!''}
                        </td>
                    </tr>
                </table>
            </div>
        </#if>
    </form>
</div>
<div>
    <br /><br />
</div>
<div style="padding:2px;margin: 0 auto;text-align: center">
    <a class="mini-button" iconCls="fa-undo" plain="true" onclick="close()">返回</a>
</div>
<div>
    <br />
</div>
<script type="text/javascript">
    mini.parse();

    var form = new mini.Form("form1");
    var zdshbzObj = mini.get("zdshbz");//最低生活保障-复选框
    var tkrygyObj = mini.get("tkrygy");//特困人员供养-复选框
    var yljzObj = mini.get("yljz");//医疗救助-复选框
    var jyjzObj = mini.get("jyjz");//教育救助-复选框
    var zfjzObj = mini.get("zfjz");//住房救助-复选框
    var qtjzObj = mini.get("qtjz");//其他救助-复选框
    var dbLxrObj = mini.get("dbLxr");//低保联系人
    var dbTelObj = mini.get("dbTel");//低保联系方式
    var tkLxrObj = mini.get("tkLxr");//特困联系人
    var tkTelObj = mini.get("tkTel");//特困联系方式
    var ylLxrObj = mini.get("ylLxr");//医疗联系人
    var ylTelObj = mini.get("ylTel");//医疗联系方式
    var jyLxrObj = mini.get("jyLxr");//教育联系人
    var jyTelObj = mini.get("jyTel");//教育联系方式
    var zfLxrObj = mini.get("zfLxr");//住房联系人
    var zfTelObj = mini.get("zfTel");//住房联系方式
    var qtLxrObj = mini.get("qtLxr");//其他联系人
    var qtTelObj = mini.get("qtTel");//其他联系方式
    var shjzObj = mini.get("shehuijiuzhu");//社会救助方式集合
    var hujiObj = mini.get("huji");//户籍

    function onLoad() {
        analysisShjz();
        onDbValueChanged();
        onTkValueChanged();
        onYlValueChanged();
        onJyValueChanged();
        onZfValueChanged();
        onQtValueChanged();
        onHjValueChanged();
    }

    //1:低保；2:特困；3:医疗；4:教育；5:住房；6:其他
    function analysisShjz() {
        if (shjzObj === undefined) {
            return;
        }
        var shjzVal = shjzObj.getValue();
        if (shjzVal.match(RegExp(/[1]/))) {
            zdshbzObj.setValue(true);
        } else {
            zdshbzObj.setValue(false);
        }
        if (shjzVal.match(RegExp(/[2]/))) {
            tkrygyObj.setValue(true);
        } else {
            tkrygyObj.setValue(false);
        }
        if (shjzVal.match(RegExp(/[3]/))) {
            yljzObj.setValue(true);
        } else {
            yljzObj.setValue(false);
        }
        if (shjzVal.match(RegExp(/[4]/))) {
            jyjzObj.setValue(true);
        } else {
            jyjzObj.setValue(false);
        }
        if (shjzVal.match(RegExp(/[5]/))) {
            zfjzObj.setValue(true);
        } else {
            zfjzObj.setValue(false);
        }
        if (shjzVal.match(RegExp(/[6]/))) {
            qtjzObj.setValue(true);
        } else {
            qtjzObj.setValue(false);
        }
    }

    //1:低保；2:特困；3:医疗；4:教育；5:住房；6:其他
    function getShjz() {
        var shjzVal = "";
        var zdshbzVal = zdshbzObj.getValue();//最低生活保障-复选框
        var tkrygyzVal = tkrygyObj.getValue();//特困人员供养-复选框
        var yljzVal = yljzObj.getValue();//医疗救助-复选框
        var jyjzVal = jyjzObj.getValue();//教育救助-复选框
        var zfjzVal = zfjzObj.getValue();//住房救助-复选框
        var qtjzVal = qtjzObj.getValue();//其他救助-复选框

        if (zdshbzVal == "1") {
            shjzVal += "1,"
        }
        if (tkrygyzVal == "1") {
            shjzVal += "2,"
        }
        if (yljzVal == "1") {
            shjzVal += "3,"
        }
        if (jyjzVal == "1") {
            shjzVal += "4,"
        }
        if (zfjzVal == "1") {
            shjzVal += "5,"
        }
        if (qtjzVal == "1") {
            shjzVal += "6,"
        }
        shjzVal = shjzVal.substr(0, shjzVal.length - 1);
        return shjzVal;
    }

    function saveData() {
        form.validate();
        if (form.isValid() == false) {
            return;
        }
        var data = form.getData();
        data.shehuijiuzhu = getShjz();
        var json = mini.encode(data);
        $.ajax({
            url: "/azbj/azbjgl/bjgzgl/saveJzInfo",
            type: "post",
            data: {data: json},
            success: function (result) {
                if (result.code == 1) {
                    mini.alert("保存成功");
                    close("close");
                }else if (result.code == 5599) {
                    mini.alert(result.message);
                } else {
                    mini.alert("保存失败");
                }
            }
        });
    }

    //户籍单选框
    function onHjValueChanged() {
        if (hujiObj === undefined) {
            return;
        }
        var hjVal = hujiObj.getValue();
        if (hjVal == "1") {
            if (document.getElementById("editformHj") != null) {
                document.getElementById("editformHj").style.display = "block";
            }
        } else {
            if (document.getElementById("editformHj") != null) {
                document.getElementById("editformHj").style.display = "none";
            }
        }
    }

    //低保复选框
    function onDbValueChanged() {
        if (zdshbzObj === undefined) {
            return;
        }
        var zdshbzVal = zdshbzObj.getValue();
        if (zdshbzVal == "1") {
            document.getElementById("editformDb").style.display = "block";
        } else {
            document.getElementById("editformDb").style.display = "none";
        }
    }

    //特困复选框
    function onTkValueChanged() {
        if (tkrygyObj === undefined) {
            return;
        }
        var tkrygyVal = tkrygyObj.getValue();
        if (tkrygyVal == "1") {
            document.getElementById("editformTk").style.display = "block";
        } else {
            document.getElementById("editformTk").style.display = "none";
        }
    }


    //医疗复选框
    function onYlValueChanged() {
        if (yljzObj === undefined) {
            return;
        }
        var yljzVal = yljzObj.getValue();
        if (yljzVal == "1") {
            document.getElementById("editformYl").style.display = "block";
        } else {
            document.getElementById("editformYl").style.display = "none";
        }
    }

    //教育复选框
    function onJyValueChanged() {
        if (jyjzObj === undefined) {
            return;
        }
        var jyjzVal = jyjzObj.getValue();
        if (jyjzVal == "1") {
            document.getElementById("editformJy").style.display = "block";
        } else {
            document.getElementById("editformJy").style.display = "none";
        }
    }

    //住房复选框
    function onZfValueChanged() {
        if (zfjzObj === undefined) {
            return;
        }
        var zfjzVal = zfjzObj.getValue();
        if (zfjzVal == "1") {
            document.getElementById("editformZf").style.display = "block";
        } else {
            document.getElementById("editformZf").style.display = "none";
        }
    }

    //其他复选框
    function onQtValueChanged() {
        if (qtjzObj === undefined) {
            return;
        }
        var qtjzVal = qtjzObj.getValue();
        if (qtjzVal == "1") {
            document.getElementById("editformQt").style.display = "block";
        } else {
            document.getElementById("editformQt").style.display = "none";
        }
    }

    function close(action) {
        if (window.CloseOwnerWindow) {
            window.CloseOwnerWindow(action);
        } else {
            window.close();
        }
    }
</script>
</body>
</html>